Copy-and-patch compilation: a fast compilation algorithm for high-level languages and bytecode

نویسندگان

چکیده

Fast compilation is important when occurs at runtime, such as query compilers in modern database systems and WebAssembly virtual machines browsers. We present copy-and-patch, an extremely fast technique that also produces good quality code. It capable of lowering both high-level languages low-level bytecode programs to binary code, by stitching together code from a large library implementation variants. call these implementations stencils because they have holes where missing values must be inserted during generation. show how construct stencil describe the copy-and-patch algorithm generates optimized demonstrate two use cases copy-and-patch: compiler for C-like language intended metaprogramming WebAssembly. Our has negligible cost: it AST less time than takes AST. implemented SQL on top this system TPC-H benchmarks, orders magnitude faster LLVM -O0 three higher optimization levels. The generated runs order interpretation 14% -O0. 4.9X-6.5X Liftoff, baseline Google Chrome. outperforms Liftoff's 39%-63% Coremark PolyBenchC benchmarks.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Compositional Compilation for Java-like Languages through Polymorphic Bytecode

We define compositional compilation as the ability to typecheck source code fragments in isolation, generate corresponding binaries, and link together fragments whose mutual assumptions are satisfied, without reinspecting the code. Even though compositional compilation is a highly desirable feature, in Java-like languages it can hardly be achieved. This is due to the fact that the bytecode gene...

متن کامل

Verified bytecode verification and type-certifying compilation

This article presents a type certifying compiler for a subset of Java and proves the type correctness of the bytecode it generates in the proof assistant Isabelle. The proof is performed by defining a type compiler that emits a type certificate and by showing a correspondence between bytecode and the certificate which entails welltyping. The basis for this work is an extensive formalization of ...

متن کامل

High-Level-Language Compilation for Reconfigurable Computers

The compiler COMRADE accepts full ANSI C and compiles it into hybrid hardware/software applications for execution on a reconfigurable adaptive computer system. After defining the model-of-computation underlying the flow, we describe the general compilation process as well as some specific techniques. These include path-based partitioning, module-generator based datapath and controller synthesis...

متن کامل

High level compilation for fine grained FPGAs

Over the past several years, Field Programmable Gate Arrays (FPGAs) have functioned effectively as specialized processors capable of an order of magnitude improved performance over workstations a t a fraction of the cost. I t is widely recognized, however, that for FPGAs to gain acceptance in the software community as algorithm accelerator$, tools to create hardware realizations of those algori...

متن کامل

Algebraic Compilation of Safety-Critical Java Bytecode

Safety-Critical Java (SCJ) is a version of Java that facilitates the development of certifiable programs, and requires a specialised virtual machine (SCJVM). In spite of the nature of the applications for which SCJ is designed, none of the SCJVMs are verified. In this paper, we contribute a formal specification of a bytecode interpreter for SCJ and an algebraic compilation strategy from Java by...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

ژورنال

عنوان ژورنال: Proceedings of the ACM on programming languages

سال: 2021

ISSN: ['2475-1421']

DOI: https://doi.org/10.1145/3485513